checked_add: make it genuinely checked (overflow traps) — resolve the wrapping misnomer#40
Merged
Conversation
… a wrapping misnomer)
checked_add was a wrapping a +% b despite its name (the GAP-1b metamorphic gate surfaced the misnomer). Now a real checked add: @addWithOverflow + unreachable -> WASM trap on overflow (all build modes, like crash_unreachable) -> wasmex {:error,_}, BEAM survives; no-overflow returns the exact sum. Signature unchanged (ABI gate still 15/15). Flip the metamorphic oracle from the wrap32 ring to non-overflow=exact-sum / overflow=trap; fix the stale 'intentional wrap' bench row + comments; reconcile CHANGELOG + PROOF-STATUS GAP-1b. AFFIRMATION left untouched (frozen at a82bb31, where it was genuinely wrapping).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 54 issues detected
View findings[
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-guest-verify.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in rust-guest-verify.yml",
"type": "missing_timeout_minutes",
"file": "rust-guest-verify.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard-enforcer.yml",
"type": "scorecard_publish_with_run_step",
"file": "scorecard-enforcer.yml",
"action": "split_scorecard_publish_job",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in instant-sync.yml",
"type": "secret_action_without_presence_gate",
"file": "instant-sync.yml",
"action": "peter-evans/repository-dispatch",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in scorecard.yml",
"type": "scorecard_wrapper_missing_job_permissions",
"file": "scorecard.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in codeql.yml",
"type": "codeql_missing_actions_language",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Python file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/snifs/snifs/benches/assert_safer.py",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "Python file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/snifs/snifs/verification/tools/abi_conformance.py",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "unsafe block -- requires SAFETY comment (4 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/snifs/snifs/rust/crates/snif-abi/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/snifs/snifs/rust/crates/demo-guest/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 54 issues detected
View findings[
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-guest-verify.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in rust-guest-verify.yml",
"type": "missing_timeout_minutes",
"file": "rust-guest-verify.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard-enforcer.yml",
"type": "scorecard_publish_with_run_step",
"file": "scorecard-enforcer.yml",
"action": "split_scorecard_publish_job",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in instant-sync.yml",
"type": "secret_action_without_presence_gate",
"file": "instant-sync.yml",
"action": "peter-evans/repository-dispatch",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in scorecard.yml",
"type": "scorecard_wrapper_missing_job_permissions",
"file": "scorecard.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in codeql.yml",
"type": "codeql_missing_actions_language",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Python file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/snifs/snifs/benches/assert_safer.py",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "Python file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/snifs/snifs/verification/tools/abi_conformance.py",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "unsafe block -- requires SAFETY comment (4 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/snifs/snifs/rust/crates/snif-abi/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/snifs/snifs/rust/crates/demo-guest/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
added a commit
that referenced
this pull request
Jun 16, 2026
…formance required) (#41) ## Summary A **fresh** AFFIRMATION snapshot, re-stamped at `main` HEAD after #39 + #40. The previous affirmation (merged in #39) is anchored to `a82bb31`, where `checked_add` genuinely *was* a wrapping misnomer — that frozen snapshot was left intact. This refresh re-anchors to `70d9f65` and folds in what changed since: - `checked_add` finding **RESOLVED** — now genuinely checked (overflow traps); the metamorphic oracle is the checked (not wrapping) one. - `abi-conformance` is now a **required** status check on `main`. - Re-anchored to `70d9f65`; **parent == anchor**. ## Verification (re-run on `main` this commit, 2026-06-16T15:03:15Z) - `just proof-check-all` → exit 0 (10 gated artifacts) - `just abi-conformance` → 15/15 (2 guests) - `mix test` → 30/30 (OTP 25) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #39.
checked_addwas a wrappinga +% bdespite its name — the GAP-1b metamorphic gate surfaced the misnomer in #39. This makes it a genuinely checked add.safe_nif.zig):@addWithOverflow+unreachable→ overflow traps (WASMunreachable, all build modes, likecrash_unreachable) → wasmex{:error, _}, BEAM survives; a non-overflowing add returns the exact sum. Signature unchanged.snif_metamorphic_test.exs): flipped from thewrap32ring oracle to non-overflow = exact sum / overflow ={:error,_}; added the boundary-trap test.benches/snif_eval.sh; reconciledCHANGELOG+PROOF-STATUSGAP-1b.The
AFFIRMATION.adoc(merged in #39, anchored toa82bb31) is intentionally not edited — at that anchorchecked_addgenuinely was wrapping, and the affirmation is a frozen, signed snapshot. A fresh affirmation can be stamped at a later commit if desired.Verification (green this commit)
just proof-check-all→ exit 0 (signature-only ABI unaffected)just abi-conformance→ 15/15 (signature unchanged)mix test→ 30/30 (OTP 25); metamorphic 9/9 under the new checked semantics@addWithOverflow+ tuple indexing +unreachable🤖 Generated with Claude Code